package com.service;

import com.dao.master.MasterDataTestDao;
import com.dao.slave.SlaveDataTestDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class ShowDataService {
    @Autowired
    private MasterDataTestDao masterDataTestDao;
    @Autowired
    private SlaveDataTestDao slaveDataTestDao;

    public String showMasterData(){
        System.out.println("=============== showMasterData =================");
        List<Map<String, Object>> list = masterDataTestDao.showMasterData();
        StringBuilder strBui = new StringBuilder();
        strBui.append("showMasterData");
        strBui.append("; ");
        strBui.append(list);
        return strBui.toString();
    }

    public String showSlaveData(){
        System.out.println("=============== showSlaveData =================");
        List<Map<String, Object>> list =slaveDataTestDao.showSlaveData();
        StringBuilder strBui = new StringBuilder();
        strBui.append("showSlaveData");
        strBui.append("; ");
        strBui.append(list);
        return strBui.toString();
    }
}
